*Change the file path to your directory"
*Use Figure2.dta in order to generate Figure 2: Attitudes Toward Immigration by Party Identification

use "/Figure2.dta"

*Generate the figure for Democrats 
twoway (bar mean fixgraph2 if label==3, color(navy))(bar mean fixgraph2 if label==1, color(midblue)) (bar mean fixgraph2 if label==2, color(blue))(rcap high low fixgraph2), legend (row(1) order(1 "Original" 2 "AI" 3 "AI Disclaimer")) xlabel( 2 "HuffPo" 6 "AP" 10 "Fox", noticks) xtitle("Ideological Slant") ylabel( 1 "Decrease Considerably" 2 "Decrease Somewhat" 3 "Present Level" 4 "Increased Somewhat" 5 "Increased Considerably", angle(horizontal)) graphregion(color(white))

*Save the figure for Dems in your directory
graph save "/Figure2Dems.gph"

*Generate the figure for Republicans
twoway (bar mean fixgraph if label==3, color(cranberry))(bar mean fixgraph if label==1, color(red))(bar mean fixgraph if label==2, color(pink))(rcap high low fixgraph), legend (row(1) order(1 "Original" 2 "AI" 3 "AI Disclaimer")) xlabel(2 "HuffPo" 6 "AP" 10 "Fox", noticks) xtitle("Ideological Slant") ylabel( 1 "Decrease Considerably" 2 "Decrease Somewhat" 3 "Present Level" 4 "Increased Somewhat" 5 "Increased Considerably", angle(horizontal)) graphregion(color(white))

*Save the figure for GOP in your directory
graph save "/Figure2GOP.gph"

*Combine the two into a 2-panel figure (make sure to include the correct directory for both file names)
graph combine "/Figure2GOP.gph" "/Figure2Dems.gph"
